/*
 * @Descripttion:
 * @version:
 * @Author: ChenXiang
 * @Date: 2021-04-08 21:22:22
 * @LastEditors: ChenXiang
 * @LastEditTime: 2021-04-15 20:19:02
 */
import React from "react";
import {
  BrowserRouter as Router,
  Switch,
  Route,
  Link,
  Redirect,
  useHistory,
  useLocation
} from "react-router-dom";
import AsyncComponent from "./component/asyncComponent";
// import { renderRoutes } from 'react-router-config'
import renderRoutes from "./component/renderRoutes";
import { Provider } from "react-redux";
import routes from "./router";

const authed = false; // 如果登陆之后可以利用redux修改该值(关于redux不在我们这篇文章的讨论范围之内）
const authPath = "/login"; // 默认未登录的时候返回的页面，可以自行设置

const App = () => (
  <Router>
    <Switch>{renderRoutes(routes, authed, authPath)}</Switch>
  </Router>
);
export default App;
